home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d17
/
print.arc
/
SETPRINT.C
< prev
Wrap
Text File
|
1987-06-13
|
2KB
|
77 lines
/*
This program will set the print density on the NEC PC8023A
by Mark J. Quarles
October, 1985
*/
#include <process.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <dos.h>
main(argc,argv)
int argc;
char *argv[];
{
int c,mode;
char word[20],*cpyrte_name[80],*cpyrte_date[80];
FILE *f1;
mode = hardware(0);
if (argc == 2) {
strcpy(word,argv[1]);
if (strcmpi(word,"/mono\0") == 0) {
mode = 1;
argc = 1;
}
}
copyrite("SETPRINT\0","December 1985\0",mode); /* display copyright notice */
/* Open the printer */
if ((f1=fopen("PRN","w")) == NULL) {
printf("Error: Printer not available\n");
exit(0);
}
printf("Select print density desired: \n\n");
printf(" <1> 10 CPI\n");
printf(" <2> 12 CPI\n");
printf(" <3> 17 CPI\n\n");
printf("Your selection (1,2, or 3): ");
/*
Loop, waiting for them to press either a '1' '2' or a '3'
*/
while (((c=getche()) != '1') && (c != '2') && (c !='3'));
/*
Now, set the print density that they selected
*/
if (c == '1') {
fprintf(f1,"%c%c",c=27,c='N');
printf("\n\nPrinter now set for 10 CPI\n\n");
}
if (c=='2') { /* 12 CPI */
fprintf(f1,"%c%c",c=27,c='E');
printf("\n\nPrinter now set for 12 CPI\n\n");
}
if (c=='3') { /* 17 cpi */
fprintf(f1,"%c%c",c=27,c='Q');
printf("\n\nPrinter now set for 17 CPI\n\n");
}
fclose(f1);
}